package com.oig.sys.auth.controller;

import com.oig.sys.auth.service.ITbOpenUserService;
import com.oig.sys.auth.vo.OpenUserVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "第三方用户管理")
@RestController
@RequestMapping(value = "/openUser")
@Slf4j
public class TbOpenUserController {

    private final ITbOpenUserService openUserService;

    @Autowired
    public TbOpenUserController(ITbOpenUserService openUserService){
        this.openUserService = openUserService;
    }


    @Operation(summary = "查看第三方用户信息")
    @PostMapping(value = "/info/{userId}")
    public OpenUserVo info(@PathVariable("userId") Integer userId){
        log.info("info OpenUserVo id={}", userId) ;
        return this.openUserService.getOpenUserInfo(userId);
    }
}
